import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View, Image, 
  TouchableOpacity,Dimensions
} from 'react-native';
const {height, width} = Dimensions.get('window');
import Toast, {DURATION} from 'react-native-easy-toast';
export default class BottomView extends Component{
  constructor(props){
    super(props);
    this.state = ({
      modal:false
    })
  }
  render(){
    let type = this.props.type;
    let shareData = [];
    let data = [
      {text: '微信',icon: require('../../images/mine/share/icon_wechat.png')},
      {text: '朋友圈',icon: require('../../images/mine/share/icon_friend.png')},
      {text: '复制链接',icon: require('../../images/mine/share/icon_link.png')},
      {text: '收藏',icon: require('../../images/mine/share/icon_coll_nor.png')},
      {text: '编辑',icon: require('../../images/mine/share/icon_edit.png')},
      {text: '预览',icon: require('../../images/mine/share/icon_view.png')},
      {text: '删除',icon: require('../../images/mine/share/icon_del.png')}
    ]
    if(type == 2){//作品
      shareData.push(data[0]);
      shareData.push(data[1]);
      shareData.push(data[2]);
      shareData.push(data[5]);
    } else if(type ==1 ){ //草稿
      shareData.push(data[4]);
      shareData.push(data[6]);
    } else { //收藏
      shareData.push(data[0]);
      shareData.push(data[1]);
      shareData.push(data[2]);
      shareData.push(data[3]);
      shareData.push(data[5]);
    }
     
    let view = [];
    for(let i=0; i<data.length; i++){
      let item = data[i];
      view.push(
        <TouchableOpacity key={i} style={{width:width/4,justifyContent:'center',alignItems:'center'}}
          onPress={this.props.press(i)}
          >
          <Image style={{width:width/8,height:width/8,
            margin:10}} source={item.icon}/>
          <Text style={{fontSize:12,color:'#333'}}>{item.text}</Text>
        </TouchableOpacity>
      )
    }
    return view;
  }
}